package config;

import config.beans.HelloWorld;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

@Configuration //作用类似我们的配置文件
@PropertySource("classpath:jdbc.properties")
public class MyApp {
    @Bean //类似我们的配置文件中的<bean></bean>
    public HelloWorld myHello() {
        HelloWorld helloWorld = new HelloWorld();
        helloWorld.setName("唐僧");
        return helloWorld;
    }
}